import Vue from 'vue'
import VueRouter from 'vue-router'

import User from '@/components/user/Index'
import UserList from '@/components/user/List'
import CreateUser from '@/components/user/Create'
import Goods from '@/components/goods/Index'
import Index from '@/components/Index'

Vue.use(VueRouter);

const router = new VueRouter({
  routes:[
    {path:'/', redirect:'index'},
    {name:'index', path:'/index', component:Index},
    {name:'user', path:'/user',component: User, redirect:'/user/index',
      children:[
        {name:'userList', path:'index', component:UserList},
        {name:'createUser', path:'create', component:CreateUser}
      ]
    },
    {name:'goods', path:'/goods', component:Goods}
  ]
})

export default router
